﻿using Firestarter.DB.Schema.BO;
using FireStarterModeller.Test;

namespace Firestarter.DB.Schema.Test.BO.TestUtils
{
    public class TestUtilsReverseEngineering
    {
        /// <summary>
        /// Creates a new saved ReverseEngineering with a random value assigned to every property
        /// </summary>
        public static ReverseEngineering CreateSavedReverseEngineering()
        {
            ReverseEngineering reverseEngineering = CreateUnsavedValidReverseEngineering();
            reverseEngineering.Save();
            return reverseEngineering;
        }

        /// <summary>
        /// Creates a new unsaved ReverseEngineering with a random value assigned to every property
        /// </summary>
        public static ReverseEngineering CreateUnsavedValidReverseEngineering()
        {
            ReverseEngineering reverseEngineering = new ReverseEngineering();
            reverseEngineering.DatabaseConnectionID = TestUtilsDatabaseConnectionInfo.CreateSavedDatabaseConnectionInfo().DatabaseConnectionID;
            reverseEngineering.StoredDatabaseID = TestUtilsDBDatabase.CreateSavedDBDatabase().DatabaseID;
            reverseEngineering.ReverseEngineeringSettingsID = TestUtilsReverseEngineeringSettings.CreateSavedReverseEngineeringSettings().ReverseEngineeringSettingsID;
            return reverseEngineering;
        }
	    
        /// <summary>
        /// Creates a new unsaved ReverseEngineering where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static ReverseEngineering CreateUnsavedDefaultReverseEngineering()
        {
            ReverseEngineering reverseEngineering = new ReverseEngineering();
            return reverseEngineering;
        }
    }
}